<script type="text/javascript" >
    stSocialMediaToolbox.load_tooltip();
    stSocialMediaToolbox.on_submitform('#settingForm');
    jQuery('.issmtp').click(function() {
        if(jQuery(this).val() == 0){            
            jQuery('#smtpContainer').fadeOut('faast', function(){
                jQuery('#smtpContainer').html('');
            });            
        }else{
            jQuery('#smtpContainer').html(jQuery('#smtpContainerText').html());
            jQuery('#smtpContainer').fadeIn();
        }
    });
    jQuery('.smtpAuthen').click(function() {
        if(jQuery(this).val() == 0){
            jQuery('#smtpUsername').attr('disabled', 'true');
            jQuery('#smtpPassword').attr('disabled', 'true');
        }else{
            jQuery('#smtpUsername').removeAttr('disabled');
            jQuery('#smtpPassword').removeAttr('disabled');
        }
    });
    <?php echo $option['isSmtp'] == 1? 'jQuery(\'#smtpContainer\').html(jQuery("#smtpContainerText").html());jQuery("#smtpContainer").css("display", "");':''?>
</script>
<div class="w100p bgl">
    <div class="w100p bgr p5b">
        <form class="stform" id="settingForm" action="<?php echo admin_url('/admin.php?page=' . $config['plugin_name'] . '&action=' . $current_action) ?>" method="post" >
                <ul>
                    <li>
                        <label><?php _e('Use smtp mode', $config['plugin_name']); ?>:</label>
                        <div>
                            <input <?php echo $option['isSmtp'] == 0? 'checked':''?> title="Not SMTP" value="0" class="issmtp required" name="data[isSmtp]" id="notsmtp" type="radio" tabindex="1" />
                            <label><?php _e('No', $config['plugin_name'])?></label>
                            <input <?php echo $option['isSmtp'] == 1? 'checked':''?> title="SMTP" value="1" class="issmtp required" name="data[isSmtp]" id="smtp" type="radio" tabindex="2" />
                            <label><?php _e('Yes', $config['plugin_name'])?></label>
                        </div>
                        <br clear="both" />
                    </li>
                    <div id="smtpContainer" style="display: none">
                        
                    </div>
                    <li>
                        <label for="From name"><?php _e('From name', $config['plugin_name']); ?></label>
                        <div>
                            <input type="text" class="" name="data[smtpFromname]" id="smtpFromname" value="<?php echo $option ['smtpFromname']; ?>" />
                        </div>
                        <br clear="both" />
                    </li>


                    <li>
                        <label for="From email"><?php _e('From email', $config['plugin_name']); ?></label>
                        <div>
                            <input type="text" class="" name="data[smtpFromemail]" id="smtpFromemail" value="<?php echo $option ['smtpFromemail']; ?>" />
                        </div>
                        <br clear="both" />
                    </li>
                    <li>
                        <input type="submit" value="Submit"/>
                    </li>
                </ul>
                                
        </form>            
    </div>
</div>

<div id="smtpContainerText" style="display: none">
    <li>
        <label for="SMTP Host"><?php _e('SMTP Host', $config['plugin_name']); ?></label>
        <div class="required">
            <input type="text" name="data[smtpHost]" class="required" id="host"  value="<?php echo $option ['smtpHost']; ?>"	 />
        </div>
        <br clear="both" />
    </li>
    <li>
        <label for="SMTP Port"><?php _e('SMTP Port', $config['plugin_name']); ?></label>
        <div class="required">
            <input type="text" name="data[smtpPort]" class="required" id="port" size="5" value="<?php echo $option ['smtpPort']; ?>"	 />
        </div>
        <br clear="both" />
    </li>
    <li>
        <label><?php _e('Encryption', $config['plugin_name']); ?>:</label>
        <br clear="both" />
    </li>
    <li>
        <label for="Encryption">&nbsp;</label>
        <div>
            <input type="radio" name="data[smtpSsl]" value="no"
            <?php echo $option['smtpSsl'] == 'no' ? 'checked' : ''; ?>
                   <?php echo!$option['smtpSsl'] ? 'checked' : ''; ?> />
                   <?php _e('No encryption', $config['plugin_name']); ?>
        </div>
        <br clear="both" />
    </li>
    <li>
        <label for="ssl">&nbsp;</label>
        <div>
            <input type="radio" id="hai" name="data[smtpSsl]" value="ssl"
                   <?php echo $option['smtpSsl'] == 'ssl' ? 'checked' : ''; ?> />
                   <?php _e('Use SSL encryption', $config['plugin_name']); ?>
        </div>
        <br clear="both" />
    </li>
    <li>
        <label for="tls">&nbsp;</label>
        <div>
            <input type="radio" id="ba" name="data[smtpSsl]"	value="tls"
                   <?php echo $option['smtpSsl'] == 'tls' ? 'checked' : ''; ?> />
                   <?php _e('Use TLS encryption', $config['plugin_name']); ?>
        </div>
        <br clear="both" />
    </li>
    <li>
        <label><?php _e('Authentication', $config['plugin_name']); ?>:</label>
        <br clear="both" />
    </li>
    <li>
        <label for="smtpAuthentication">&nbsp;</label>
        <div>
            <input type="radio" id="smtpAuthentication" name="data[smtpAuthentication]" value="0" class="smtpAuthen"
                   <?php echo $option['smtpAuthentication'] == '0' ? 'checked' : ''; ?> />
                   <?php _e('No: Do not use SMTP authentication', $config['plugin_name']); ?>
        </div>
        <br clear="both" />
    </li>

    <li>
        <label for="smtpAuthentication 2">&nbsp;</label>
        <div>
            <input type="radio" name="data[smtpAuthentication]" value="1" class="smtpAuthen"
            <?php echo $option['smtpAuthentication'] == '1' ? 'checked' : ''; ?>
                   <?php echo!$option['smtpAuthentication'] ? 'checked' : ''; ?> />
                   <?php _e('Yes: Use SMTP authentication', $config['plugin_name']); ?>
        </div>
        <br clear="both" />
    </li>

    <li>
        <label for="smtpUsername"><?php _e('Username', $config['plugin_name']); ?></label>
                       <div>
                           <input type="text" name="data[smtpUsername]"
                                  class="required" id="smtpUsername"
                                  value="<?php echo $option ['smtpUsername']; ?>"
                   <?php echo $option['smtpAuthentication'] == '0' ? 'disabled="true"' : ''; ?>
                   class="new" />
        </div>
        <br clear="both" />
    </li>


    <li>
        <label for="smtpPassword"><?php _e('Password', $config['plugin_name']); ?></label>
                       <div>
                           <input type="password"
                                  class="required" name="data[smtpPassword]"
                                  id="smtpPassword"
                                  value="<?php echo $option ['smtpPassword']; ?>"
                   <?php echo $option['smtpAuthentication'] == '0' ? 'disabled="true"' : ''; ?>
                   class="new" />
        </div>
        <br clear="both" />
    </li>

</div>